/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.clooud.modulos.eventos.controller;

import com.clooud.modulos.eventos.model.EventoModel;
import com.clooud.util.pmf.PMF;
import java.util.ArrayList;
import java.util.List;
import javax.jdo.PersistenceManager;

/**
 *
 * @author selvino
 */
public class EventosController {

    public static List<EventoModel> getEventos() {
        PersistenceManager pm = PMF.getPersistenceManager();
        try {
            List<EventoModel> eventosList = new ArrayList<EventoModel>();
            eventosList.addAll((List<EventoModel>) pm.newQuery(EventoModel.class).execute());
            return eventosList;
        } finally {
            pm.close();
        }
    }
}
